<?php

declare(strict_types=1);

namespace Plugin\Attractions\Commerce\Model\Commerce_settlement;

use Hyperf\Database\Model\SoftDeletes;
use Hyperf\DbConnection\Model\Model;

/**
 * @property int $id 结算单号
 * @property int $merchant_id 商户ID
 * @property int $order_count 订单数量
 * @property string $total_revenue 销售额
 * @property string $settlement_amount 应结算金额
 * @property string $paid_amount 已结算金额
 * @property int $settlement_status 结算状态：1-待结算，2-已结算
 * @property string $settlement_date 结算日期
 * @property int $payment_method 付款方式1-银行转账,2-微信支付,3-支付宝支付,4-现金,5-其他付款方式
 * @property string $remark 备注
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class CommerceSettlement extends Model
{
    use SoftDeletes;
    public bool $incrementing = false;
    protected string $primaryKey = 'id';
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'commerce_settlement';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'merchant_id', 'order_count', 'total_revenue', 'settlement_amount', 'paid_amount', 'settlement_status', 'settlement_date', 'payment_method', 'remark', 'created_at', 'updated_at', 'deleted_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'merchant_id' => 'integer', 'order_count' => 'integer', 'total_revenue' => 'decimal:2', 'settlement_amount' => 'decimal:2', 'paid_amount' => 'decimal:2', 'settlement_status' => 'integer', 'payment_method' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
}
